<?php
if (isset($_SESSION['openid']) && isset($_POST['id']) ){
    include '../c/config.php';
    $mysqli = new mysqli($dbhost, $dbuser, $dbpwd, $dbName);
    if (!$mysqli->set_charset("utf8")) {printf("Error loading character set utf8: %s\n", $mysqliTwo->error);}
    $openid=$_SESSION['openid'];
    $query=$mysqli->query("select jp from chou where openid='".$openid."'  ");
 
    $dataInfo=array();
    while ($list=$query->fetch_array()){
        if(5 == $list['jp']){
            //$list['jp']='t';
        }
        if (isset($dataInfo[$list['jp']])){
            $dataInfo[$list['jp']]=1+$dataInfo[$list['jp']];
        }else{
            $dataInfo[$list['jp']]=1;
        }
        
    }
     
    echo json_encode(array('d'=>$dataInfo));
}else{
    echo json_encode(array('n'=>0));
}